<?php
 class PDORepository{
  const USERNAME="webqu";
  const PASSWORD="MhxzKhl#";
  const HOST="rm-m5e3chzm2kyq1d12l.mysql.rds.aliyuncs.com";
  const DB="zhaoqianhua";

  private function getConnection(){
    $username = self::USERNAME;
    $password = self::PASSWORD;
    $host = self::HOST;
    $db = self::DB;
    $connection = new PDO("mysql:dbname=$db;host=$host", $username, $password);
    return $connection;
  }
  public function queryList($sql, $args){
    $connection = $this->getConnection();
    $stmt = $connection->prepare($sql);
    $stmt->execute($args);
    return $stmt;
  }
}
$db = new PDORepository();
$sql='select * from customer limit 1';
$data=$db->queryList($sql,'');
var_dump($data);
?>